package com.sky.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @Description:
 * @author: nianqiang
 * @Version: V1.0
 */
@Component   // 组件扫描,为当前类创建实例化对象,执行任务
public class MyTask {

		//七子表达式
		//@Scheduled(cron = "1,5,10 * * * * ?")
		public void task() {
				System.out.println("闹钟响了,当前时间: " + LocalDateTime.now());
		}

}
